home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Games / Solitaire / Sources / FortyThieves / FTDrawDelegate.m < prev    next >
Encoding:
Text File  |  1994-04-20  |  894 b   |  43 lines

  1.  
  2. #import "FTDrawDelegate.h"
  3. #import "../Solitaire/CardSet.subproj/cardset.h"
  4. #import "localstrings.h"
  5.  
  6. @implementation FTDrawDelegate
  7.  
  8. - setDiscardCardPileView:theView
  9. {
  10.     discardPileView = theView;
  11.     return self;
  12. }
  13.  
  14.  
  15. - clickedCard:aCard in:drawCardPileView
  16. {
  17.     id    drawCardPile = [drawCardPileView cardPile];
  18.     id    discardPile = [discardPileView cardPile];
  19.     id    drawCard;
  20.     
  21.     if ([drawCardPile cardCount])
  22.     {
  23.     [[drawCardPileView window] disableFlushWindow];
  24.     drawCard = [drawCardPile cardAt:CS_TOP];
  25.     [drawCardPile removeCard:drawCard];
  26.     [drawCard flip];
  27.     [discardPile addCard:drawCard];
  28.     [drawCardPileView display];
  29.     [discardPileView display];
  30.     [[drawCardPileView window] reenableFlushWindow];
  31.     [[drawCardPileView window] flushWindow];
  32.     }
  33.     else{
  34.     NXRunAlertPanel(LOCALIZED_GAME_NAME,LOCALIZED_NO_STOCK_CARD,
  35.     "OK", NULL, NULL);
  36.     }
  37.  
  38.     return self;
  39. }
  40.  
  41.  
  42. @end
  43.